home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / I-Z / ViewIt™ Shareware.sea / ViewIt™ 2.04 Shareware / FaceWare.rsrc / TEXT_1319_BC9. Dial Controls.txt < prev    next >
Text File  |  1992-08-15  |  4KB  |  24 lines

  1. Dial Controls
  2.   Dial controls must be of type "Dial Control", and have solid bodies.  The purpose of "dials" is to support the selection of numbers via the mouse, and/or to graphically display the magnitude of a variable (such as the progress of a calculation).
  3.  
  4. Operation
  5.   The body, frame, indentation, etc., settings are used in the expected way by BaseCt when displaying dials.  The content of a dial, however, indicates the current control Value relative to the control's Min and Max.  The default appearance of dials is to show the Value as a solid bar drawn in the current content color, filling a fraction of the content area equal to (Value - Min)/(Max - Min).  The default behavior of dials is to automatically resize the bar as the user clicks and drags within the content area of the dial.
  6.  
  7. Options
  8.   The following bit values can be added to VarCode to set various dial control options:
  9. 1 = disable auto-tracking.  Set this option when the dial is being used for display purposes only.
  10. 2 = round dial.  Forces the content to be drawn using painted arcs instead of rectangles.  Auto-tracking is also done in a circular fashion.
  11. 4 = fill current value only.  Causes just the fraction of the dial's content corresponding to the current Value to be filled (rather than Value - Min).  The visual effect is to create a rectangle or wedge that acts like the box or thumb seen in standard scroll bars.  NOTE:  When this option is set, the displayed Values are Min + 1 to Max, and the user cannot set Value equal to Min (i.e. box or wedge is always displayed).  Thus, for example, a dial with Min = 0 & Max = 10 would display 10 Values (1 to 10) corresponding to 10 distinct box or wedge positions.
  12. 8 = draw extra frame around content, or, if dial is round, draw vertical line to denote Min value.  (Note that if the frame and content are same color, then you won't be able to see the extra frame being drawn.)
  13. 16 = auto-update linked variable as dial's Value is changed by user (GetVal is called by BaseCt), and update the state of all other controls in the same view that are linked to the same program variable (BaseCt calls SetVal).  This makes it easy, for example, to associate a dial with a text item that is then updated as the dial is adjusted (i.e., link both controls to same variable and add 16 to dial's VarCode).  WARNING:  If you link multiple controls to the same variable, and then use GetVal to get the values of all controls in the window, then the highest numbered control that is linked to the variable will be the one whose value is seen by the program.  If a dial is associated with an editable text item, for example, then the editable item should be placed after the dial in the control list so that the value in the editable item is read, OR GetVal should be called in way that only returns the value of the editable item (since the user can type a value in the editable item that is different from the dial's).
  14.  
  15. Data Linking
  16.   Data linking is based on the standard control Value.  Use SetVal (with linked dials) or SetCtlValue (any dial) to change a dial's appearance by resetting its current control Value.
  17.   The title of a dial control can be optionally used to set an intercept "a" and slope "b" that is to be used when interconverting variables and values, where,
  18.   program variable = a + (b)(control value)
  19. The intercept and slope specified in the title should be separated by a single comma (e.g., "-20,1.23"), and can be any real or integer number that can be stored as a 10-byte real.  If the dial's title is empty, then BaseCt uses intercept = 0 and slope = 1 (i.e., control value and program variable are the same).
  20.   The intercept and slope specified by a dial's title can be changed at any time by using SetCTitle to reset the control's title.  The dial's Min and Max define the "precision" of the dial (the total number of distinct values that a user can select), and can also be changed at any time by using SetCtlMin or SetCtlMax.
  21.   NOTE:  More complex links between dial controls and variables can be implemented by simply overriding the dial's "getCntl" (GetVal) and "setCntl" (SetVal) control messages with a main program procedure that does the conversion of value <-> variable.
  22.  
  23. Limitations
  24.   No support for control colors other than frame, body, & content.  No support for hand scrolling.